using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SMWJamecl.BusinessEntities;

namespace SMWJamecl.Repository.Mapping
{
    public class MarcaMap : EntityTypeConfiguration<Marca>
    {
        public MarcaMap()
        {
            // Primary Key
            this.HasKey(t => t.Id_Marca);

            // Properties
            this.Property(t => t.Id_Marca)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Desc_Marca)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Marca");
            this.Property(t => t.Id_Marca).HasColumnName("Id_Marca");
            this.Property(t => t.Desc_Marca).HasColumnName("Desc_Marca");
        }
    }
}
